using Sage.Http.Authentication;
using Sage.Http.Models;

namespace Sage.Http.Extensions
{
    /// <summary>
    /// HttpRequestBuilder的扩展方法，提供更便捷的链式API
    /// </summary>
    [Obsolete("此类已过时，请使用HttpExtensions类中的方法")]
    public static class HttpRequestBuilderExtensions
    {
        /// <summary>
        /// 添加Bearer Token认证
        /// </summary>
        /// <param name="builder">HTTP请求构建器</param>
        /// <param name="token">认证令牌</param>
        /// <param name="scheme">认证方案，默认为"Bearer"</param>
        /// <returns>当前构建器实例，用于链式调用</returns>
        [Obsolete("此方法已过时，请使用HttpExtensions.WithBearerToken方法")]
        public static Core.HttpRequestBuilder WithBearerToken(this Core.HttpRequestBuilder builder, string token, string scheme = "Bearer")
        {
            return HttpExtensions.WithBearerToken(builder, token, scheme);
        }

        /// <summary>
        /// 添加Basic认证
        /// </summary>
        /// <param name="builder">HTTP请求构建器</param>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>当前构建器实例，用于链式调用</returns>
        [Obsolete("此方法已过时，请使用HttpExtensions.WithBasicAuth方法")]
        public static Core.HttpRequestBuilder WithBasicAuth(this Core.HttpRequestBuilder builder, string username, string password)
        {
            return HttpExtensions.WithBasicAuth(builder, username, password);
        }

        /// <summary>
        /// 添加API Key认证
        /// </summary>
        /// <param name="builder">HTTP请求构建器</param>
        /// <param name="apiKey">API密钥</param>
        /// <param name="parameterName">参数名称</param>
        /// <param name="location">认证位置</param>
        /// <returns>当前构建器实例，用于链式调用</returns>
        [Obsolete("此方法已过时，请使用HttpExtensions.WithApiKey方法")]
        public static Core.HttpRequestBuilder WithApiKey(this Core.HttpRequestBuilder builder, string apiKey, string parameterName, ApiKeyLocation location = ApiKeyLocation.Header)
        {
            return HttpExtensions.WithApiKey(builder, apiKey, parameterName, location);
        }
    }
}
